package com.fkcai.hansoul.model.vo.user;

import com.fkcai.hansoul.model.entity.User;
import lombok.Data;

import java.time.LocalDateTime;

/**
 * 用户完整信息
 */
@Data
public class UserFullVo {
	private Integer userId;         // id
	private String username;        // 用户名
	private String phone;           // 手机
	private String gender;          // 性别
	private String avatarUrl;       // 头像地址
	private String coverUrl;        // 封面地址
	private String location;        // 地点
	private String bio;             // 简介名
	private Integer userLevel;      // 等级
	private Integer userPoints;     // 积分
	private LocalDateTime birthday; // 生日
	private LocalDateTime lastUsernameUpdateTime;   // 最后更新用户名时间
	
	public static UserFullVo fromUser (User user) {
		UserFullVo userFullVo = new UserFullVo();
		
		userFullVo.setUserId(user.getUserId());
		userFullVo.setUsername(user.getUsername());
		userFullVo.setPhone(user.getPhone());
		userFullVo.setGender(user.getGender());
		userFullVo.setAvatarUrl(user.getAvatarUrl());
		userFullVo.setCoverUrl(user.getCoverUrl());
		userFullVo.setLocation(user.getLocation());
		userFullVo.setBio(user.getBio());
		userFullVo.setUserLevel(user.getUserLevel());
		userFullVo.setUserPoints(user.getUserPoints());
		userFullVo.setBirthday(user.getBirthday());
		userFullVo.setLastUsernameUpdateTime(user.getLastUsernameUpdateTime());
		
		return userFullVo;
	}
}
